/*
 * Stack.cpp
 *
 *  Created on: 11.10.2010
 *      Author: Luke
 */

#include "Stack.h"


Stack::Stack() {

	top = 0;
}

Stack::~Stack() {

}

void Stack::push(Node* node){

	top = new Element(node, top);
}

Node* Stack::pop(){

	Element* result = top;

	if (result != 0){
		top = result->getPred();
	}
	else{

		top = 0;
	}

	return result->getNode();
}

bool Stack::isEmpty(){

	if (top == 0){
		return true;
	}
	else{
		return false;
	}
}
